<?php
require_once '/../Modele/BaseModel.php';
require_once('ForumTopic.php');

/**
 * @access public
 * @author Joana
 * @package Mapping_Dead.Modele
 */
class ForumSection extends BaseModel {

    /**
     * @AttributeType int
     */
    protected $idForumSection;

    /**
     * @AttributeType String
     */
    protected $nomSection;

    /**
     * @AttributeType String
     */
    protected $idUser;

    /**
     * @AttributeType String
     */
    protected $dateCreation;

    /**
     * @AttributeType int
     */
    protected $droitVisite;
    
    /**
     * @AttributeType String
     */
    protected $resumeSection;

    public function __construct($id = null) {
        parent::__construct($id);
    }

    /**
     * @access public
     * @return int
     * @ReturnType int
     */
    public function getIdSection() {
        return $this->idSection;
    }

    /**
     * @access public
     * @param int idSection
     * @return void
     * @ParamType idSection int
     * @ReturnType void
     */
    public function setIdSection($idSection) {
        $this->idSection = $idSection;
    }

    function getIdForumSection() {
        return $this->idForumSection;
    }

    function getNomSection() {
        return $this->nomSection;
    }

    function getIdUser() {
        return $this->idUser;
    }

    function getDateCreation() {
        return $this->dateCreation;
    }

    function getDroitVisite() {
        return $this->droitVisite;
    }

    function getResumeSection() {
        return $this->resumeSection;
    }

    function setIdForumSection($idForumSection) {
        $this->idForumSection = $idForumSection;
    }

    function setNomSection($nomSection) {
        $this->nomSection = $nomSection;
    }

    function setIdUser($idUser) {
        $this->idUser = $idUser;
    }

    function setDateCreation($dateCreation) {
        $this->dateCreation = $dateCreation;
    }

    function setDroitVisite($droitVisite) {
        $this->droitVisite = $droitVisite;
    }

    function setResumeSection($resumeSection) {
        $this->resumeSection = $resumeSection;
    }

    
    /**
     * @access public
     * @return String[]
     * @ReturnType String[]
     */
    public function afficherListeSection() {
        return parent::findAll();
    }

    /**
     * @access public
     * @param int idSection
     * @return Topic[]
     * @ParamType idSection int
     * @ReturnType Topic[]
     */
    public function getListeTopics($idSection) {
        $args = array('idSection'=>$idSection);
        return $this->getElement($args);
    }

    /**
     * @access public
     * @param int idTopic
     * @return Message[]
     * @ParamType idTopic int
     * @ReturnType Message[]
     */
    public function afficherListeMessage($idTopic) {
        // Not yet implemented
    }

    /**
     * @access public
     * @param int idSection
     * @param String libelle
     * @ParamType idSection int
     * @ParamType libelle String
     */
    public function creerTopic($idSection, $libelle) {
        $topic = new ForumTopic();
	return $topic->getListeTopics($idSection);
    }

    /**
     * @access public
     * @param int idTopic
     * @param String texte
     * @param String pieceJointe
     * @ParamType idTopic int
     * @ParamType texte String
     * @ParamType pieceJointe String
     */
    public function creerMessage($idTopic, $texte, $pieceJointe) {
        // Not yet implemented
    }

    /**
     * @access public
     * @param int idTopic
     * @ParamType idTopic int
     */
    public function supprimerTopic($idTopic) {
        // Not yet implemented
    }

    /**
     * @access public
     * @param int idMessage
     * @ParamType idMessage int
     */
    public function supprimerMessage($idMessage) {
        // Not yet implemented
    }

}

?>